Integrand size = 25, antiderivative size = 75 \[ \int \cot ^2(e+f x) \sqrt {a+b \tan ^2(e+f x)} \, dx=-\frac {\sqrt {a-b} \arctan \left (\frac {\sqrt {a-b} \tan (e+f x)}{\sqrt {a+b \tan ^2(e+f x)}}\right )}{f}-\frac {\cot (e+f x) \sqrt {a+b \tan ^2(e+f x)}}{f} \]
-arctan((a-b)^(1/2)*tan(f*x+e)/(a+b*tan(f*x+e)^2)^(1/2))*(a-b)^(1/2)/f-cot (f*x+e)*(a+b*tan(f*x+e)^2)^(1/2)/f
Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.
Time = 0.28 (sec) , antiderivative size = 64, normalized size of antiderivative = 0.85 \[ \int \cot ^2(e+f x) \sqrt {a+b \tan ^2(e+f x)} \, dx=-\frac {\cot (e+f x) \operatorname {Hypergeometric2F1}\left (-\frac {1}{2},1,\frac {1}{2},-\frac {(a-b) \tan ^2(e+f x)}{a+b \tan ^2(e+f x)}\right ) \sqrt {a+b \tan ^2(e+f x)}}{f} \]
-((Cot[e + f*x]*Hypergeometric2F1[-1/2, 1, 1/2, -(((a - b)*Tan[e + f*x]^2) /(a + b*Tan[e + f*x]^2))]*Sqrt[a + b*Tan[e + f*x]^2])/f)
Time = 0.28 (sec) , antiderivative size = 73, normalized size of antiderivative = 0.97, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.280, Rules used = {3042, 4153, 377, 25, 27, 291, 216}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \cot ^2(e+f x) \sqrt {a+b \tan ^2(e+f x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\sqrt {a+b \tan (e+f x)^2}}{\tan (e+f x)^2}dx\) |
\(\Big \downarrow \) 4153 |
\(\displaystyle \frac {\int \frac {\cot ^2(e+f x) \sqrt {b \tan ^2(e+f x)+a}}{\tan ^2(e+f x)+1}d\tan (e+f x)}{f}\) |
\(\Big \downarrow \) 377 |
\(\displaystyle \frac {\int -\frac {a-b}{\left (\tan ^2(e+f x)+1\right ) \sqrt {b \tan ^2(e+f x)+a}}d\tan (e+f x)-\cot (e+f x) \sqrt {a+b \tan ^2(e+f x)}}{f}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {\cot (e+f x) \left (-\sqrt {a+b \tan ^2(e+f x)}\right )-\int \frac {a-b}{\left (\tan ^2(e+f x)+1\right ) \sqrt {b \tan ^2(e+f x)+a}}d\tan (e+f x)}{f}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {\cot (e+f x) \left (-\sqrt {a+b \tan ^2(e+f x)}\right )-(a-b) \int \frac {1}{\left (\tan ^2(e+f x)+1\right ) \sqrt {b \tan ^2(e+f x)+a}}d\tan (e+f x)}{f}\) |
\(\Big \downarrow \) 291 |
\(\displaystyle \frac {\cot (e+f x) \left (-\sqrt {a+b \tan ^2(e+f x)}\right )-(a-b) \int \frac {1}{1-\frac {(b-a) \tan ^2(e+f x)}{b \tan ^2(e+f x)+a}}d\frac {\tan (e+f x)}{\sqrt {b \tan ^2(e+f x)+a}}}{f}\) |
\(\Big \downarrow \) 216 |
\(\displaystyle \frac {-\sqrt {a-b} \arctan \left (\frac {\sqrt {a-b} \tan (e+f x)}{\sqrt {a+b \tan ^2(e+f x)}}\right )-\cot (e+f x) \sqrt {a+b \tan ^2(e+f x)}}{f}\) |
(-(Sqrt[a - b]*ArcTan[(Sqrt[a - b]*Tan[e + f*x])/Sqrt[a + b*Tan[e + f*x]^2 ]]) - Cot[e + f*x]*Sqrt[a + b*Tan[e + f*x]^2])/f
3.4.3.3.1 Defintions of rubi rules used
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*A rcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a , 0] || GtQ[b, 0])
Int[1/(Sqrt[(a_) + (b_.)*(x_)^2]*((c_) + (d_.)*(x_)^2)), x_Symbol] :> Subst [Int[1/(c - (b*c - a*d)*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]
Int[((e_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_) , x_Symbol] :> Simp[(e*x)^(m + 1)*(a + b*x^2)^(p + 1)*((c + d*x^2)^q/(a*e*( m + 1))), x] - Simp[1/(a*e^2*(m + 1)) Int[(e*x)^(m + 2)*(a + b*x^2)^p*(c + d*x^2)^(q - 1)*Simp[b*c*(m + 1) + 2*(b*c*(p + 1) + a*d*q) + d*(b*(m + 1) + 2*b*(p + q + 1))*x^2, x], x], x] /; FreeQ[{a, b, c, d, e, p}, x] && NeQ[b *c - a*d, 0] && LtQ[0, q, 1] && LtQ[m, -1] && IntBinomialQ[a, b, c, d, e, m , 2, p, q, x]
Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Simp[c*(ff/f) Subst[Int[(d*ff*(x/c))^m*((a + b*(ff*x)^n)^p/(c^2 + f f^2*x^2)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ[n, 2] || EqQ[n, 4] || (IntegerQ[p] && Ratio nalQ[n]))
Leaf count of result is larger than twice the leaf count of optimal. \(299\) vs. \(2(67)=134\).
Time = 4.50 (sec) , antiderivative size = 300, normalized size of antiderivative = 4.00
method | result | size |
default | \(\frac {\left (\arctan \left (\frac {\sqrt {\frac {a \cos \left (f x +e \right )^{2}+b \sin \left (f x +e \right )^{2}}{\left (\cos \left (f x +e \right )+1\right )^{2}}}\, \left (\cot \left (f x +e \right )+\csc \left (f x +e \right )\right )}{\sqrt {a -b}}\right ) a \sin \left (f x +e \right )-\arctan \left (\frac {\sqrt {\frac {a \cos \left (f x +e \right )^{2}+b \sin \left (f x +e \right )^{2}}{\left (\cos \left (f x +e \right )+1\right )^{2}}}\, \left (\cot \left (f x +e \right )+\csc \left (f x +e \right )\right )}{\sqrt {a -b}}\right ) b \sin \left (f x +e \right )-\cos \left (f x +e \right ) \sqrt {a -b}\, \sqrt {\frac {a \cos \left (f x +e \right )^{2}+b \sin \left (f x +e \right )^{2}}{\left (\cos \left (f x +e \right )+1\right )^{2}}}-\sqrt {a -b}\, \sqrt {\frac {a \cos \left (f x +e \right )^{2}+b \sin \left (f x +e \right )^{2}}{\left (\cos \left (f x +e \right )+1\right )^{2}}}\right ) \sqrt {a +b \tan \left (f x +e \right )^{2}}\, \cot \left (f x +e \right )}{f \sqrt {a -b}\, \left (\cos \left (f x +e \right )+1\right ) \sqrt {\frac {a \cos \left (f x +e \right )^{2}-b \cos \left (f x +e \right )^{2}+b}{\left (\cos \left (f x +e \right )+1\right )^{2}}}}\) | \(300\) |
1/f/(a-b)^(1/2)*(arctan(1/(a-b)^(1/2)*((a*cos(f*x+e)^2+b*sin(f*x+e)^2)/(co s(f*x+e)+1)^2)^(1/2)*(cot(f*x+e)+csc(f*x+e)))*a*sin(f*x+e)-arctan(1/(a-b)^ (1/2)*((a*cos(f*x+e)^2+b*sin(f*x+e)^2)/(cos(f*x+e)+1)^2)^(1/2)*(cot(f*x+e) +csc(f*x+e)))*b*sin(f*x+e)-cos(f*x+e)*(a-b)^(1/2)*((a*cos(f*x+e)^2+b*sin(f *x+e)^2)/(cos(f*x+e)+1)^2)^(1/2)-(a-b)^(1/2)*((a*cos(f*x+e)^2+b*sin(f*x+e) ^2)/(cos(f*x+e)+1)^2)^(1/2))*(a+b*tan(f*x+e)^2)^(1/2)/(cos(f*x+e)+1)/((a*c os(f*x+e)^2-b*cos(f*x+e)^2+b)/(cos(f*x+e)+1)^2)^(1/2)*cot(f*x+e)
Time = 0.35 (sec) , antiderivative size = 257, normalized size of antiderivative = 3.43 \[ \int \cot ^2(e+f x) \sqrt {a+b \tan ^2(e+f x)} \, dx=\left [\frac {\sqrt {-a + b} \log \left (-\frac {{\left (a^{2} - 8 \, a b + 8 \, b^{2}\right )} \tan \left (f x + e\right )^{4} - 2 \, {\left (3 \, a^{2} - 4 \, a b\right )} \tan \left (f x + e\right )^{2} + a^{2} - 4 \, {\left ({\left (a - 2 \, b\right )} \tan \left (f x + e\right )^{3} - a \tan \left (f x + e\right )\right )} \sqrt {b \tan \left (f x + e\right )^{2} + a} \sqrt {-a + b}}{\tan \left (f x + e\right )^{4} + 2 \, \tan \left (f x + e\right )^{2} + 1}\right ) \tan \left (f x + e\right ) - 4 \, \sqrt {b \tan \left (f x + e\right )^{2} + a}}{4 \, f \tan \left (f x + e\right )}, -\frac {\sqrt {a - b} \arctan \left (-\frac {2 \, \sqrt {b \tan \left (f x + e\right )^{2} + a} \sqrt {a - b} \tan \left (f x + e\right )}{{\left (a - 2 \, b\right )} \tan \left (f x + e\right )^{2} - a}\right ) \tan \left (f x + e\right ) + 2 \, \sqrt {b \tan \left (f x + e\right )^{2} + a}}{2 \, f \tan \left (f x + e\right )}\right ] \]
[1/4*(sqrt(-a + b)*log(-((a^2 - 8*a*b + 8*b^2)*tan(f*x + e)^4 - 2*(3*a^2 - 4*a*b)*tan(f*x + e)^2 + a^2 - 4*((a - 2*b)*tan(f*x + e)^3 - a*tan(f*x + e ))*sqrt(b*tan(f*x + e)^2 + a)*sqrt(-a + b))/(tan(f*x + e)^4 + 2*tan(f*x + e)^2 + 1))*tan(f*x + e) - 4*sqrt(b*tan(f*x + e)^2 + a))/(f*tan(f*x + e)), -1/2*(sqrt(a - b)*arctan(-2*sqrt(b*tan(f*x + e)^2 + a)*sqrt(a - b)*tan(f*x + e)/((a - 2*b)*tan(f*x + e)^2 - a))*tan(f*x + e) + 2*sqrt(b*tan(f*x + e) ^2 + a))/(f*tan(f*x + e))]
\[ \int \cot ^2(e+f x) \sqrt {a+b \tan ^2(e+f x)} \, dx=\int \sqrt {a + b \tan ^{2}{\left (e + f x \right )}} \cot ^{2}{\left (e + f x \right )}\, dx \]
\[ \int \cot ^2(e+f x) \sqrt {a+b \tan ^2(e+f x)} \, dx=\int { \sqrt {b \tan \left (f x + e\right )^{2} + a} \cot \left (f x + e\right )^{2} \,d x } \]
\[ \int \cot ^2(e+f x) \sqrt {a+b \tan ^2(e+f x)} \, dx=\int { \sqrt {b \tan \left (f x + e\right )^{2} + a} \cot \left (f x + e\right )^{2} \,d x } \]
Timed out. \[ \int \cot ^2(e+f x) \sqrt {a+b \tan ^2(e+f x)} \, dx=\int {\mathrm {cot}\left (e+f\,x\right )}^2\,\sqrt {b\,{\mathrm {tan}\left (e+f\,x\right )}^2+a} \,d x \]